#include "GlobalSetting.h"
#include <qsettings.h>
#include <qfile.h>

GlobalSetting* GlobalSetting::instance = nullptr;


GlobalSetting::GlobalSetting()
{
	settings = new QSettings("settings.ini", QSettings::IniFormat);
	 
}

GlobalSetting::~GlobalSetting()
{
	delete settings;
}

GlobalSetting* GlobalSetting::getInstance()
{
	if (nullptr == instance)
	{
		instance = new GlobalSetting();
	}

	return instance;
}

NoteEdit::EditType GlobalSetting::getDefaultEditType()
{
	
	NoteEdit::EditType editType = NoteEdit::EditType(settings->value("DefaultEditType").toInt());

	return editType;
}

QString GlobalSetting::getSavePath()
{
	return settings->value("SavePath").toString();
}

